% SQL
% SPARQL
% DBPedia
% p2pfoundation
% MoveCommons
% Ontologías:
% dbpedia
% yago
% wikipedia
% evaluación

Our proposal establishes a semantic similarity measure among Move Commons\cite{movecommons} initiatives from the study of the semantic similarity of their keywords. Given an initiative, our tool computes its similarity to a set of other initiatives, the most similar initiatives are then shown to the user as initiatives related to the initial one. In next subsection we present an example used through the paper to illustrate our technique, following subsections explain the process in detail.
%\begin{itemize}
%\item TODO MOVE TO EVAL Search for the Initiatives and their keywords in p2pfoundation wiki (Section \ref{sec:data}).
%\item Assign a Wikipedia/DBpedia concept to each keyword (Section \ref{sec:concepts}).
%\item Compute the semantic distance to the target Initiative using semantic categorization information recursively (Section \ref{sec:simil}).
%\item Present the five most similar initiatives to the user (Section \ref{sec:out}).
%\end{itemize}
\subsection{Running example}
The comparison of the initiatives called ``DisparaLaPalabra''\cite{disparaLaPalabra} and ``Hacklab de Barracas''\cite{hacklabBarracas} which information is obtained from their Spanish page in p2pfoundation's\cite{p2pfoundation} wiki will help us to illustrate the algorithm of our proposal (Figure \ref{fig:init}).
\begin{figure}
  \centering
  \begin{tabularx}{\textwidth}{|l|X|X|}
    \hline
    &  \emph{DisparaLaPalabra} &\emph{Hacklab de Barracas} \\
    \hline
    \textbf{keywords\footnote{Note that the original keywords are in Spanish and have not been yet associated with a Wikipedia article}} 
    & DisparaLaPalabra, Literatura, Poesía, cultura libre, Creative Commons & hacklab, software libre, hardware libre \\
    \hline
\end{tabularx}
  
  \caption{Example initiatives.}
  \label{fig:init}
\end{figure}

%\subsection{The data TODO MOVE TO EVAL}
%\label{sec:data}
%Our work is applied to the set of p2pfoundation.net Articles in Spanish with available MoveCommons information. This data set consists of $196$ initiatives. The wiki page of the initiatives is accessed by our tool and parsed to obtain the keywords associated with the initiatives. $75$ initiatives that does not have keywords are not further considered.

\subsection{Keyword categorization}
To obtain semantic information from keywords written in natural language, we try to assign each keyword to a Wikipedia article. First, the keywords are searched in Spanish Wikipedia and then the English equivalent article is obtained. This is performed using Wikipedia API. The English article is named as the DBPedia concept, and can now be used to obtain its categories querying DBPedia ontology. The results of this process applied to the initiatives of our running example can be seen in Figure \ref{fig:cat}.

\begin{figure}
  \centering
  \small
  \begin{tabularx}{\textwidth}{|l|l|X|}
    \hline
    \emph{Keyword} & \emph{Concept} & \emph{Categories} \\
    \hline
    DisparaLaPalabra &  &  \\
    Literatura & Literature &  	
    Fiction,
    Humanities,
    Literature\\
    Poesía & Poetry &  	
    Literary genres,
    Aesthetics,
    Genres,
    Literature,
    Poetry,
    Spoken word,
    Greek loanwords\\
    cultura libre & Free culture movement & 
    Intellectual property activism,
    Social movements,
    Open methodologies\\
    Creative Commons & Creative Commons & 
    Organizations established in 2001,
    Computer law,
    Free music,
    Creative Commons,
    Copyleft\\
    \hline
    hacklab & Hackerspace & DIY culture,
Hackerspace,
Computer clubs \\ 
    software libre & Free software & Software licenses, Free software \\ 
    hardware libre  & Open-source hardware & Open source hardware\\ 
    \hline
  \end{tabularx}
  \caption{Keyword categorization process}
  \label{fig:cat}
\end{figure}

We can see that in the process we have lost the keyword \emph{DisparaLaPalabra}. This inaccuracies can be introduced in this phase of the algorithm by the following cases:
\begin{itemize}
\item The keyword does not represent a concept in Wikipedia.
\item The keyword is misspelled.
\item The keyword is ambiguous.
\item The keyword is written in another language.
\end{itemize}
%%% This step fails to obtain at least one concept in $11$ initiatives that are not further considered.
\subsection{Semantic similarity}
\label{sec:simil}
Once the initiatives are categorized as introduced in previous section, we can establish the semantic similarity among them. Since the categories belong to a hierarchy, we can find semantic similarities between two categories by finding their common ancestors. The similarity $s_k(k_1,k_2)$ between the keywords $k1$, $k2$ with categories $c_{1,1},\dots,c_{1,n_1}$, $c_{2,1},\dots,c_{2,n_2}$ is defined as the number of common subsumers of their categories (Formula \ref{eq:sk}, Figure \ref{fig:sk}), with a limited depth of 2 levels (prune the search of common subsumers not only decreases the time of the algorithm but improves the quality of the semantic comparison\cite{Milne_2007}). We define the semantic similarity $s_i(i_1,i_2)$ among the initiatives $i_1$, $i_2$ characterized by the sets of keywords  $k_{1,1},\dots,k_{1,m_1}$, $k_{2,1},\dots,k_{2,m_2}$ as the maximum of the shared Wikipedia Categories among two keywords from different sets (Formula \ref{eq:si}). In Figure \ref{fig:si} we can see the computed similarity between the initiatives of our example.

\begin{equation} \label{eq:sk}
s_k(k_1,k_2) = \vert\vert \bigcup_{i=1}^{n_1}(sub_2(c_{1,i})) \cap \bigcup_{j=1}^{n_2}(sub_2(c_{i,j})) \vert\vert
\end{equation}

\begin{equation} \label{eq:sk}
  s_i(i_1,i_2) = max(\{s_k(k_{1,i},k_{2,j} \vert i \in \{1, \dots, m_1\} i \in \{1, \dots, m_2\} )\})
\end{equation}

\begin{figure}
  \centering
  \small
  \begin{tabularx}{\textwidth}{|c|X|X|X|}
\hline
   $s_k(k_1,k_2)$ & $\bigcup_{i=1}^{n_1}(sub_2(c_{1,i}))$ & $\bigcup_{j=1}^{n_2}(sub_2(c_{i,j}))$ & $\bigcup_{i=1}^{n_1}(sub_2(c_{1,i})) \cap \bigcup_{j=1}^{n_2}(sub_2(c_{i,j}))$ \\
\hline
 2 & Computer law ,          
  Contract law  ,         
 \textbf{Copyright licenses} ,
 Free software ,   
\textbf{Open methodologies},     
  Software distribution,  
  Software licenses   & nonprofit organizations                   , 
Activism by issue                                   , 
Civil law (common law)                              , 
Computer law organizations                          , 
Consumer protection                                 , 
Copyleft                                            , 
Copyright law                                       , 
Copyright law organizations                         , 
\textbf{Copyright licenses}, 
Creative Commons                                    , 
Cultures                                            , 
Digital audio                                       , 
Free content                                        , 
Free music                                          , 
Intellectual property activism                      , 
Intellectual property law                           , 
\dots ,
\textbf{Open methodologies}                                  , 
\dots
   &  \textbf{Copyright licenses} ,
\textbf{Open methodologies} \\
\hline
\hline
  \end{tabularx}
  \caption{Keyword similarity example for $k_1$ = Free Software, $k_2$ = Creative Commons}
  \label{fig:sk}
\end{figure}

\begin{figure}
  \centering
  \begin{tabularx}{\textwidth}{|X|X|X|X|}
    \hline
    $s_i = 2$ & \textbf{Hackerspace} & \textbf{Free software} & \textbf{Open-source Hardware} \\
    \hline
\textbf{Literature} & 0 & 0 & 0 \\ 
\textbf{Poetry} & 0 & 0 & 0 \\
\textbf{Free Culture Movement} & 0 & 1 & 0 \\
\textbf{Creative Commons} & 0 & \textbf{2} & 0 \\
    \hline   
  \end{tabularx}
  \caption{Initiatives similarity for the running example}
  \label{fig:si}
\end{figure}

%TODO The subtype relation for DBpedia Ontology and for YAGO\cite{Suchanek07yago:a} ontology was also considered but finally discarded due to the better coverage of Wikipedia categories (more DBpedia elements had Wikipedia Categories than DBpedia classification).
%TODO Querying the semantic database of DBPedia with recursive relations is really cost consuming. To improve the performance of the prototype, the categories of the initiatives are obtained only once and saved in a local SQL database from which further results are obtained.

\subsection{Output}\label{sec:out}
The tool gives the five most similar initiatives to the input initiative taking into account the similarity function we have defined. This initiatives are presented to the user as similar initiatives to the input initiative.

